Warn if none of documentation, homepage or repository are provided
authorSteven Fackler <sfackler@gmail.com>
Mon, 15 Dec 2014 04:43:38 +0000 (20:43 -0800)
committerSteven Fackler <sfackler@gmail.com>
Tue, 16 Dec 2014 07:41:50 +0000 (23:41 -0800)
It's really hard to find out any information about a project if it
doesn't have any of these.

As a bonus I added a shebang to .travis.install.deps.sh so the README
instructions actually work.

Closes #998

.travis.install.deps.sh
src/cargo/ops/cargo_package.rs
tests/test_cargo_package.rs
tests/test_cargo_registry.rs

index 90c25a7da98d1cd28ba9c70f73e5867a3fd5ccd7..2c3b35d4e021fd67f32538c103939e276c668925 100755 (executable)
@@ -1,3 +1,5 @@
+#!/bin/bash
+
 set -x
 set -e
 
index 0e6336aad9401d937287c08623395ed008e42102..174f72f2e2660f1ca56612c6d312e1cf333d0ff1 100644 (file)
@@ -83,7 +83,7 @@ fn check_metadata(pkg: &Package, shell: &mut MultiShell) -> CargoResult<()> {
             )*
         }}
     }
-    lacking!(description, license || license_file)
+    lacking!(description, license || license_file, documentation || homepage || repository)
 
     if !missing.is_empty() {
         let mut things = missing.slice_to(missing.len() - 1).connect(", ");
index c3f2eccade03030abea8e8e8d7b2ef14b64f6924..87c1b3efae49515ad979351678df7f7f697140c5 100644 (file)
@@ -81,7 +81,8 @@ test!(metadata_warning {
         compiling = COMPILING,
         dir = p.url()).as_slice())
                 .with_stderr("\
-warning: manifest has no description, license or license-file. See \
+warning: manifest has no description, license, license-file, documentation, \
+homepage or repository. See \
 http://doc.crates.io/manifest.html#package-metadata for more info."));
 
     let p = project("one")
@@ -106,10 +107,10 @@ http://doc.crates.io/manifest.html#package-metadata for more info."));
         compiling = COMPILING,
         dir = p.url()).as_slice())
                 .with_stderr("\
-warning: manifest has no description. See \
+warning: manifest has no description, documentation, homepage or repository. See \
 http://doc.crates.io/manifest.html#package-metadata for more info."));
 
-    let p = project("both")
+    let p = project("all")
         .file("Cargo.toml", format!(r#"
             [project]
             name = "foo"
@@ -117,6 +118,7 @@ http://doc.crates.io/manifest.html#package-metadata for more info."));
             authors = []
             license = "MIT"
             description = "foo"
+            repository = "bar"
         "#))
         .file("src/main.rs", r#"
             fn main() {}
index 601587a0b2ca2eecf7b1e801ea539cb295610d85..bd3dcbb8d76f1b6ee3def4b39ccb6f060900e8d8 100644 (file)
@@ -179,6 +179,7 @@ test!(package_with_path_deps {
             authors = []
             license = "MIT"
             description = "foo"
+            repository = "bar"
 
             [dependencies.notyet]
             version = "0.0.1"
@@ -491,6 +492,7 @@ test!(bad_license_file {
             authors = []
             license-file = "foo"
             description = "bar"
+            repository = "baz"
         "#)
         .file("src/main.rs", r#"
             fn main() {}